<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
	<title>搜索商机</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui-win.css" />
<style type="text/css">
/*设置内容区样式*/
body {
	min-width: 320px;
}
.searchDiv img {
	position: absolute;
	right: 8%;
	top: 80px;
}
.searchDiv input[type="text"] {
	margin-top: 25px;
	width: 90%;
	margin-left: 2.5%;
	height: 36px;
	border-radius: 36px;
	border: 1px solid dimgray;
	padding-left: 5%;
	color: #B3B3B3;
}
#news {
	background-color: #f2f2f2;
	margin-top: 20px;
}
#news ul li {
	overflow: hidden;
}
#news ul li a {
	display: block;
	overflow: hidden;
	padding: 10px 10px 10px 10px;
	border-bottom: 1px solid #d9d9d9;
}
#news ul li a.active {
	background-color: #d9e4e9;
}
#img {
	float: left;
	width: 90px;
	height: 90px;
	border-radius: 4px;
}
#news .content {
	width: 65%;
	margin-left: 100px;
	overflow: hidden;
}
#news .content h2, #news h2 {
	font-size: 16px;
	font-weight: 800;
	color: #00abfd;
	margin-bottom: 6px;
	white-space: nowrap;
  	text-overflow: ellipsis;
  	overflow: hidden;
}
#news .content p {
	height: 20px;
	width: 100%;
	color: #999;
	font-size: 14px;
	word-wrap: break-word;
}
#news .t .content div:after {
	content: "专题";
	background-color: #55abce;
	border: 1px solid #55abce;
	border-radius: 4px;
	color: #fff;
	font-size: 12px;
	padding: 2px 6px;
	float: right;
	height: 14px;
	line-height: 14px;
}
.time {
	float: right;
	right: 2.5%;
}
.lookicon {
	width: 20px;
	height: 12px;
	padding: 0px 1px 0px 0px;
}
.icon {
	width: 12px;
	height: 12px;
	padding: 0px 1px 0px 3px;
}
#warnDiv{
	width:100%;
	height:300px;
	text-align:center;
	font-size:20px;
}
#warnDiv span{
	margin-top:140px;
}
</style>
</head>
<body>
	<div id="tanChu1">
<p>数据请求失败！</p>
	<input type="button" value="确定" id="tanChu_btn1">
</div>

	<header class="aui-bar aui-bar-nav aui-bar-yunzo" id="aui-header">
		<a class="aui-btn aui-bar-yunzo aui-pull-left" id="back" > <span class="aui-iconfont aui-icon-left"></span></a>
		<div class="aui-title" id="title">
			搜索商机
		</div>
		<a class="aui-iconfont aui-icon-menu aui-pull-right"></a>
	</header>
	<div class="margin_div"></div>
	<div class="searchDiv">
		<img src="../../image/home/busess/search.png" onclick="fuzzySearch()">
		<input type="text" placeholder="查找商机" id="fuzzyText" onchange="textvalue(this);">
	</div>
	<div id="news">
		<ul  id="txtNewsList"></ul>
	</div>
<script src="../../script/jquery-1.10.2.min.js"></script>
<script src="../../script/common.js"></script>
<script type="text/javascript">
var pagesize=5;
var curCount=0;
var listDataArr;
var likevalue="";
var obj;
$(document).ready(function(){
	obj = $('#txtNewsList');
	$("#back").attr("href","busess_list.html");
});

function textvalue(el)
{
	likevalue=el.value;
}
function openNews(listDataArr,i)
{
	alert(i);
}
//点击进行模糊查询
sTart_Stop();
function fuzzySearch() {
	if(likevalue!=undefined&&likevalue.length>0)
	{	
	var Post ={"groupid":$groupid,"mid":$mid,"pagesize":pagesize,"did":66666,"type":1,"curcount":curCount,"likevalue":likevalue};
	//groupid="+$groupid+"&mid="+$mid+"&pagesize="+pagesize+"&did=66666&type=0&curCount="+curCount+"&likevalue="+likevalue;
	$.ajax({
	   url:'../../../api/group/getgroupbusinessinfobytradelist',
	   contentType: "application/json;charset=utf-8",
	   type:'post',
	   dataType:'json',
	   data:JSON.stringify(Post),
	   success:function(msg){
		 obj.innerHTML = "";
		if(msg.code==100)
		{
			var html='';
			var thisItem;
			if (msg.data.length> 0) {
				var objs = [];
				var praisesSrc;
				var len = msg.data.length;
				listDataArr = new Array();
				curCount = curCount + len;
				for (var i = 0; i < len; i++) {
					thisItem = msg.data[i];
					if (thisItem.n10 == 0) {
						praisesSrc = "../../image/home/busess/praiseIcon.png";
					} else {
						praisesSrc = "../../image/home/busess/noPraiseIcon.png";
					}
					if(thisItem.n1=="null"||thisItem.n1==null){
						busessImg="../../image/yunzo_def.png"
					}else{
						if(thisItem.n1.indexOf(',')!=-1)
						{
							busessImg=thisItem.n1.split(',')[0];
						}else
							busessImg=thisItem.n1;
					}
					
					listDataArr[i] = [thisItem.n0, thisItem.n2, busessImg, thisItem.n5, thisItem.n3, thisItem.n4, thisItem.n7, thisItem.n8, thisItem.n9];
					
					html += '<li><a tapmode="active" onclick="openinfo(listDataArr,' + i + ')"><div class="logo"><img id="img" src="' + busessImg + '"/></div><div class="content"><h2>' + thisItem.n2;
					html += '</h2><p class="name">' + thisItem.n4 + '</p><p class="company">' + thisItem.n5 + '</p><img class="lookicon" src="../../image/home/busess/browseIcon.png"><span>' + thisItem.n7 + '</span><img class="icon" src="../../image/home/busess/commentIcon.png"><span>' + thisItem.n8;
					html += '</span><img class="icon" src="' + praisesSrc + '"><span>' + thisItem.n9 + '</span><div class="time"><img class="icon" src="../../image/home/busess/timeIcon.png"><span>' + thisItem.n3 + '</span></div></div></a></li>';
				}
			
				obj.append(html);
			}else{
				
				obj.html("<div style='width:20%;margin:40px 0 0 40%;'><img src='../../image/gantan.png' style='width:100%;'></div><p style='width:100%;text-align:center;margin-top:30px;color:#999;font-size:18px;'>没有你要查找的商机！</p>");
			}
		}else{
			$("body").append('<div class="wuwang"><img src="../../image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
		}
			  
	}});
	}else{
		
		return;
	}
}
function openinfo(arr,i){
	var localData =  window.localStorage;
	window.location ="../first_frame/busess_info.html?infoid="+arr[i][0]+"&title="+arr[i][1]+"&logoImg="+arr[i][2]+"&bussCopny="+arr[i][3]+"&bussTime="+arr[i][4]+"&bussPub="+arr[i][5]+"&bussBrws="+arr[i][6]+"&bussComts="+arr[i][7]+"&bussPris="+arr[i][8]+"&isColltect="+arr[i][9];
}
</script>
</body>
</html>